<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html">
	<h:head>
		<f:facet name="first">
            <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
            <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
            <title>WebCRM</title>
        </f:facet>
		<title><ui:insert name="title">WebCRM</ui:insert>
		</title>
		 <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/default.css" />
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/syntaxhighlighter/syntaxhighlighter.css" />

	</h:head>

	<h:body>

		<p:layout fullPage="true">
			<p:growl id="msgs" showDetail="true" life="4000" />			
			<p:layoutUnit id="top" position="north" size="80">
				<div id="logo" class="ui-widget-header ui-corner-all"
					style="height: 30px;">
					<h1 style="font-size: 23px">WebCRM</h1>
					<div id="logout"
						style="position: fixed; top: 20px; left: 88%; z-index: 1">
						<h:form prependId="false">
							<h:outputLabel
								value="Bem vindo! #{controleAcessoMB.usuario.login}  " />
						</h:form>
					</div>
				</div>
				<h:form>
					<p:menubar autoSubmenuDisplay="true" >
						<p:submenu label="Cadastros" icon="ui-icon ui-icon-contact">
							<p:submenu label="Entidades">
								<p:menuitem value="Nova Entidade" onclick="manterEntidadeDialog.show();" />
								<p:menuitem value="Tipos de Entidade"
									url="manterTipoEntidade.jsf" />
								<p:menuitem value="Atividade" url="manterAtividade.jsf" />
								<p:menuitem value="Tipos de Endereço"
									url="manterTipoEndereco.jsf" />
								<p:menuitem value="Cidades" url="manterCidade.jsf" />
								<p:menuitem value="Tipos de Telefones"
									url="manterTipoTelefone.jsf" />
							</p:submenu>
							<p:submenu label="Eventos">
								<p:menuitem value="Motivos para eventos" url="manterMotivo.jsf" />
							</p:submenu>
							<p:submenu label="Usuários">
								<p:menuitem value="Grupos de usuários" url="manterGrupo.jsf" />
								<p:menuitem value="Usuários" url="manterUsuario.jsf" />
							</p:submenu>
							<p:menuitem value="Alterar Senha" url="alteraSenha.jsf" />
						</p:submenu>

						<p:submenu label="Telemarketing" icon="ui-icon ui-icon-note">
							<p:menuitem value="Cadastrar Questionários" url="manterQuestionario.jsf" />
						</p:submenu>
						<p:menuitem value="Sair" icon="ui-icon ui-icon-power" ajax="false"
							actionListener="#{controleAcessoMB.deslogar}" />
					</p:menubar>
				</h:form>
			</p:layoutUnit>

			<p:layoutUnit id="bottom" position="south" size="25" 
				styleClass="homeRodaPe" >
				<h:outputLabel id="homeRodaPe"
					value="WebCRM 2011. Todos reservados." />
			</p:layoutUnit>

			<p:layoutUnit id="left" position="west" size="73" resizable="false">
				<h:form>
					<h:panelGrid>
						<p:button id="buscaEntidade" styleClass="botaoBarraVertical" outcome="manterEntidade.jsf"
							title="Listar entidades" 
							style="background: url(imagens/search.png) center no-repeat !important;" />
						<p:tooltip for="buscaEntidade" showEffect="slide" />	
						<p:button id="buscaEvento" styleClass="botaoBarraVertical"
							outcome="manterEvento.jsf" title="Listar eventos"
							style="background: url(imagens/eventos.png) center no-repeat !important;" />						
						<p:tooltip for="buscaEvento" showEffect="slide" />
                	
					</h:panelGrid>
				</h:form>
			</p:layoutUnit>

			<p:layoutUnit id="center" position="center">
				<ui:insert name="container">
				</ui:insert>
			</p:layoutUnit>

		</p:layout>
		
		<ui:insert name="dialog">
		</ui:insert>

		<p:dialog modal="true" widgetVar="statusDialog"  header="Processando..."
			draggable="false" closable="false"  >
			 <p:graphicImage value="/imagens/ajax-loader.gif" />
		</p:dialog>
		
		<ui:insert name="status">
            <p:ajaxStatus   style="display:block;position:fixed;right:50%;top:50%;z-index:6000;">
                <f:facet name="start">
                    <p:graphicImage value="/imagens/ajax-loader.gif" />
                </f:facet>

                <f:facet name="complete">
                    <h:outputText value="" />
                </f:facet>
            </p:ajaxStatus>
        </ui:insert>
	
		<p:dialog  id="manterEntidadeDialog" widgetVar="manterEntidadeDialog"  header="Entidade: #{entidadeMB.entidadeSelecionada.nomeEntidade}"
			maximizable="true" minimizable="true" width="900" height="450">
			<ui:include src="includeManterEntidade.xhtml" />
		</p:dialog>
		
	</h:body>

</f:view>
</html>

